<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php

/**
 * @author ThangTCNB
 * @copyright 2011
 */
echo "Welcome to my PHP";
echo "<br />";
$link = mysql_connect('localhost','root','');
if(!$link)
{
    die('Khong the truy cap vao CSDL'.mysql_errno());
}
echo "Connect thanh cong";
/*
mysql_select_db("tckt");
$sql = "Select id,TenGV from giangvien where khoa = (Select id from khoa where tenkhoa ='Khoa Tài Chính')";
$result = mysql_query($sql);
//var_dump($result);
while($row = mysql_fetch_array($result))
{
    echo "asdasd";
    //printf($row[0],$row[1]);
}
*/
mysql_select_db("joomla");
$sql = "Select introtext from jos_content where id = 121";
mysql_query('SET NAMES utf8 COLLATE utf8_general_ci');
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result, MYSQL_NUM)) 
{
    printf("ID %s", $row[0]);  
}

//mysql_free_result($result);


?>
</body>
</html>